import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;


/**
 * 
 */

/**
 * @author zero
 * 
 */
public class CleanBlockList implements Iterable<List<Block>>
{
    private Map<Integer, List<Block>> list = new TreeMap<Integer, List<Block>>();

    public void addBlock(Block block)
    {

        List<Block> blockList = list.get(block.cleanLevel);
        if (null == blockList)
        {
            blockList = new ArrayList<Block>();
            list.put(block.cleanLevel, blockList);
        }
        blockList.add(block);

    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Iterable#iterator()
     */
    @Override
    public Iterator<List<Block>> iterator()
    {
        // TODO Auto-generated method stub
        return list.values().iterator();
    }
}
